/**
 * ...
 * @author nzgl
 */

package tab;

import flash.events.KeyboardEvent;
import flash.Lib;
import flash.text.TextField;
import flash.text.TextFieldType;
import gui.hug.HUGInputFieldSB;
import gui.hug.HUGSprite;
import gui.hug.HUGTabbedPanel;
import gui.hug.Tab;

import list.NewList;
import list.OpenTabEvent;

import loader.Loader;

import client.Item;

class FindInFavTab extends Tab
{

	private static inline var 	TITLE = "";
	private var loader : 	Loader;
	private var newsList : 	NewList;
	private var sprite : HUGSprite;
	
	
	
	public function new(name : String, panel : HUGTabbedPanel = null, uid : Int = 0) 
	{		
	 sprite 	= new HUGSprite();	
	 loader 	= new Loader();
	 newsList   = new NewList(4, 7, 600);
	 sprite.addChild(newsList);
	 loader.searchInFavorites(onLoad, name);
	 super(sprite, name, 1,panel, true);
	}
	
	public function onLoad(data : Array<Item>) : Void
	{
		for (item in data)
		{
			newsList.addItem(item,1);
		}
	}	
}